<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/admin.Master" CodeBehind="Users.aspx.cs"
    Inherits="LiveWebServiceAdmin.users" %>

<asp:Content ContentPlaceHolderID="MenuContent" ID="PageType" runat="server">
    <p>
        A</p>
</asp:Content>
<asp:Content ContentPlaceHolderID="TopContent" ID="PageInfo" runat="server">
    Welcome to Administration!
    <br />
    <br />
    User at this Server:
</asp:Content>
<asp:Content ContentPlaceHolderID="TopBannerContent" ID="PageAbout" runat="server">
    About Live@edu MWS
</asp:Content>
<asp:Content ContentPlaceHolderID="BottomBannerContent" ID="Content1" runat="server">
    Manage your users here.
</asp:Content>
<asp:Content ContentPlaceHolderID="BottomContent" ID="PageMain" runat="server">
    <table id="usertable" width="100%">
        <tr align="center">
            <td colspan="4">
                <asp:ListBox ID="lbServiceUsers" runat="server" Height="250px" Width="100%" SelectionMode="Single"
                    OnSelectedIndexChanged="UserChanged"></asp:ListBox>
                <asp:Label ID="lbError" runat="server" Text="" Visible="false"></asp:Label>
            </td>
        </tr>
        <tr align="center">
            <td>
                <a id="newuser" href="ActionPages\manageusers.aspx?keepThis=true&TB_iframe=true&height=125&width=380"
                    title="Create new service User" class="thickbox">Add User</a>
            </td>
            <td>
                <div id="viewuser">
                    <a href="javascript:void(0)" title="View service User organizations">View User organizations</a>
                </div>
            </td>
            <td>
                <div id="edituser">
                    <a href="javascript:void(0)" title="Edit service User" class="thickbox">Edit User</a>
                </div>
            </td>
            <td>
                <div id="deleteuser">
                    <%--<a href="javascript:void(0)" title="Delete service User" class="thickbox">Delete User</a>--%>
                    <asp:Button ID="btnDeleteOrg" CssClass="buttonlink" runat="server" Text="Delete User"
                        OnClick="btnDeleteOrg_Click" />
                </div>
            </td>
        </tr>
    </table>
    <div>

        <script language="javascript" type="text/javascript">
            $(document).ready(function() {
                $("#viewuser").hide();
                $("#viewuser").find("a").attr("href", "javascript:void(0)");

                $("#edituser").hide();
                $("#edituser").find("a").attr("href", "javascript:void(0)");

                $("#deleteuser").hide();
                $("#deleteuser").find("a").attr("href", "javascript:void(0)");
            });

            $("#usertable").find("select").click(function(event) {
                var options = $("#usertable").find("option").each(function(index) {
                    if ($(this).attr("selected")) {
                        $("#viewuser").show();
                        $("#viewuser").find("a").attr("href", "/organizations.aspx?manageuser=" + $(this).text());

                        $("#edituser").show();
                        $("#edituser").find("a").attr("href", "/ActionPages/manageusers.aspx?edituser=" + $(this).text() + "&keepThis=true&TB_iframe=true&height=125&width=380");

                        $("#deleteuser").show();
                        $("#deleteuser").find("a").attr("href", "/ActionPages/manageusers.aspx?deleteuser=" + $(this).text() + "&keepThis=true&TB_iframe=true&height=125&width=380");
                    }
                }
                );
            });
        </script>

    </div>
</asp:Content>
